from celery import Celery

app = Celery(
    'task',  # 当前模块的名字
    broker='amqp://guest@localhost//',  # 消息队列的url
    # backend='amqp://guest@localhost//',  # 将调用的结果存储到MQ中
    backend='redis://localhost:6379/9'  # 将调用的结果存储到Redis中
)


@app.task
def send_sms_code(mobile, sms_code):
    # send_sms(mobile, sms_code)
    return "短信发送成功，mobile:%s,sms_code:%s" % (mobile, sms_code)
